
import {
  createHashRouter,
  RouterProvider,
  // RouterProvider,
} from "react-router-dom";
import { lazy} from 'react'

const Layout = lazy(() => import('@/layouts/index'));
const Login = lazy(() => import('@/pages/Login/index'));
const User = lazy(() => import('@/pages/User'));
const Team =  lazy(() => import('@/pages/Team/index'));
const Role =  lazy(() => import('@/pages/Role/index'));
const Dashboard = lazy(() => import('@/pages/Dashboard'));
const Logs = lazy(() => import('@/pages/Logs'));
const Files = lazy(() => import('@/pages/Files'));
const Images = lazy(() => import('@/pages/Images'));

const router = createHashRouter([
  {
    path: "/",
    element: <Layout />,
    children: [
      {
        path: "team",
        element: <Team />,
        // loader: teamLoader,
      },
      {
        path: "user",
        element: <User />,
      },
      {
        path: "role",
        element: <Role />
      },
      {
        path: '/dashboard',
        element: <Dashboard />
      },
      {
        path: '/files',
        element: <Files />
      },
      {
        path: '/images',
        element: <Images />
      },
      {
        path: '/logs',
        element: <Logs />
      }
    ],
  },
  {
    path: 'login',
    element: <Login />
  }
]);

const RouterApp = () => (
  <RouterProvider router={router}></RouterProvider>

)
export default RouterApp